/* ardw.t   ACCOUNTS RECEIVABLE DETAIL WRITE TRIGGER                      */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                    */
/* All rights reserved worldwide.  This is an unpublished work.           */
/*-------------------------------------------------------------------------
    File        : ardw.t
    Description : Schema WRITE trigger associated with the ard_det table.
    Notes       :


    This program is provided as a starting point for QAD and customer
    personnel to add processing triggered by write activity against the
    ard_det table of MFG/PRO.

    All write-trigger processing should be contained in subprograms
    called by this program.  In order to add such processing logic to
    to the trigger, place a DO-END block just after the TRIGGER PROCEDURE
    statement below to perform the following functions:
    (1) Check appropriate field values to determine whether processing
    is required;
    (2) Move the relevant fields to a work-table or temp-table;
    (3) Call the appropriate subprogram with the necessary parameters,
    typically the old values of the fields as well as ROWID for the new
    values.

    History :

    REVISION: 9.1        CREATED: 08/19/99  BY: *N01S* Fred Yeadon
    REVISION: 9.1  LAST MODIFIED: 09/16/99  BY: *N030* Robert Jensen
    REVISION: 9.1  LAST MODIFIED: 02/16/00  BY: *N07N* Robert Jensen
    REVISION: 9.1  LAST MODIFIED: 08/11/00  BY: *N0KK* jyn
  ------------------------------------------------------------------------*/

/*==============================  Tokens  ===================================*/
/*V8:ConvertMode=NoConvert                                                   */
/*===========================================================================*/

/*===========================================================================*/
/* ***************************  Definitions  ******************************* */
/*===========================================================================*/

/*===========================================================================*/
/* ***************************  Main Block   ******************************* */
/*===========================================================================*/

TRIGGER PROCEDURE FOR WRITE OF ARD_DET OLD BUFFER OLD_ARD_DET.

/*N07N*//*Supply the old table values to lgpyex to determine differences */

/*N030*/{mfdeclre.i}

/*N07N*/define new shared temp-table tt_ard_det no-undo like ard_det.

/*N030*//* Logistics Interface processing */
/*N030*/LG:
/*N030*/do:
/*N030*/   /* If Logistics is in place, process */
/*N030*/   if can-find (first lgs_mstr where lgs_app_id > "") then do:
/*N07N*/      create tt_ard_det.
/*N07N*/      if recid(tt_ard_det) = -1 then .
/*N07N*/      buffer-copy old_ard_det to tt_ard_det.
/*N030*//*    Call subprogram to publish changed status for Logistics */
/*N030*/      {gprunmo.i &module="LG"
/*N030*/      &program="lgpyex.p"
/*N030*/      &param="""(input recid(ard_det))"""}
/*N07N*/      if available (tt_ard_det) then delete tt_ard_det.
/*N030*/   end.
/*N030*/end. /* LG */
/*N030*//*End of Added Section */
